<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/init.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<jsp:include page="/WEB-INF/jsp/common/common.jsp" />
<jsp:include page="/WEB-INF/jsp_lib/validate.jsp" />
<script type="text/javascript">
	$(function() {
		$("#form1").validate({
			rules : {
				'name' : {
					required : true
				}
			}
		});
	});

	function mySubmit() {
		var job_codes = "";
		$job_code = $("input[name='job_code']");
		$.each($job_code, function() {
			if ($(this).attr("checked") == "checked") {
				job_codes += $(this).val() + ",";
			}
		});
		$("input[name='job_codes']").val(job_codes);

		$("#form1").submit();
	}
</script>
</head>
<body>
	<jsp:include page="/WEB-INF/jsp_lib/tip.jsp" />
	<!-- 内容 -->
	<div>
		<form method="post" action="${path}/ix/wkflow/add.htm" id="form1">
			<input type="hidden" name="job_codes" value="" />
			<h2>
				<div>新建业务流程</div>

			</h2>
			<table width="100%" class="lindex">
				<tr>
					<th align="right">名称：</th>
					<td align="left" colspan="3"><input name="name" type="text"
						maxlength="100" /></td>
				</tr>
				<tr>
					<th align="right">流程：</th>
					<td align="left" colspan="3"><c:forEach items="${jobList}"
							var="v">
							<input type="checkbox" name="job_code" value="${v.code}" />${v.name}审批<br />
						</c:forEach></td>
				</tr>
				<tr>
					<th align="right">描述：</th>
					<td align="left" colspan="3"><input name="note" type="text"
						maxlength="100" /></td>
				</tr>
			</table>
			<div class="options">
				<a href="javascript:mySubmit();" class="asave"> 【保存】 </a> <a
					href="javascript:goBack();" class="asave"> 【返回】 </a>
			</div>
		</form>

	</div>
</body>
</html>